/**
 * Copyright (c) 2010, Andrew Carter
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without modification, are 
 * permitted provided that the following conditions are met:
 * 
 * Redistributions of source code must retain the above copyright notice, this list of 
 * conditions and the following disclaimer. Redistributions in binary form must reproduce 
 * the above copyright notice, this list of conditions and the following disclaimer in 
 * the documentation and/or other materials provided with the distribution. Neither the 
 * name of Andrew Carter nor the names of contributors may be used to endorse or promote 
 * products derived from this software without specific prior written permission. 
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 
 * SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 
 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR 
 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
package com.acarter.scenemonitor.propertydescriptor;

import com.acarter.propertytable.PropertyTable;
import com.acarter.scenemonitor.propertydescriptor.A_PropertyPageHandler;
import com.acarter.scenemonitor.propertydescriptor.definitions.ControllerPropertyPage;
import com.acarter.scenemonitor.propertydescriptor.definitions.DirectionalLightPropertyPage;
import com.acarter.scenemonitor.propertydescriptor.definitions.GeometryPropertyPage;
import com.acarter.scenemonitor.propertydescriptor.definitions.LightPropertyPage;
import com.acarter.scenemonitor.propertydescriptor.definitions.PointLightPropertyPage;
import com.acarter.scenemonitor.propertydescriptor.definitions.NodePropertyPage;
import com.acarter.scenemonitor.propertydescriptor.definitions.SpatialPropertyPage;
import com.acarter.scenemonitor.propertydescriptor.definitions.SpotLightPropertyPage;
import com.acarter.scenemonitor.propertydescriptor.definitions.TexturePropertyPage;
import com.acarter.scenemonitor.propertydescriptor.definitions.renderstate.BlendStatePropertyPage;
import com.acarter.scenemonitor.propertydescriptor.definitions.renderstate.ClipStatePropertyPage;
import com.acarter.scenemonitor.propertydescriptor.definitions.renderstate.ColorMaskStatePropertyPage;
import com.acarter.scenemonitor.propertydescriptor.definitions.renderstate.CullStatePropertyPage;
import com.acarter.scenemonitor.propertydescriptor.definitions.renderstate.FogStatePropertyPage;
import com.acarter.scenemonitor.propertydescriptor.definitions.renderstate.LightStatePropertyPage;
import com.acarter.scenemonitor.propertydescriptor.definitions.renderstate.MaterialStatePropertyPage;
import com.acarter.scenemonitor.propertydescriptor.definitions.renderstate.RenderStatePropertyPage;
import com.acarter.scenemonitor.propertydescriptor.definitions.renderstate.ShadeStatePropertyPage;
import com.acarter.scenemonitor.propertydescriptor.definitions.renderstate.StencilStatePropertyPage;
import com.acarter.scenemonitor.propertydescriptor.definitions.renderstate.TextureStatePropertyPage;
import com.acarter.scenemonitor.propertydescriptor.definitions.renderstate.WireframeStatePropertyPage;
import com.acarter.scenemonitor.propertydescriptor.definitions.renderstate.ZBufferStatePropertyPage;
import com.acarter.scenemonitor.propertydescriptor.editor.ColorRGBAEditor;
import com.acarter.scenemonitor.propertydescriptor.editor.QuaternionEditor;
import com.acarter.scenemonitor.propertydescriptor.editor.Vector3fEditor;
import com.acarter.scenemonitor.propertydescriptor.propertyobject.ColorRGBAPropertyObject;
import com.acarter.scenemonitor.propertydescriptor.propertyobject.QuaternionPropertyObject;
import com.acarter.scenemonitor.propertydescriptor.propertyobject.Vector3fPropertyObject;
import com.acarter.scenemonitor.propertydescriptor.renderer.ColorRGBARenderer;
import com.acarter.scenemonitor.propertydescriptor.renderer.QuaternionRenderer;
import com.acarter.scenemonitor.propertydescriptor.renderer.Vector3fRenderer;
import com.ardor3d.image.Texture;
import com.ardor3d.light.DirectionalLight;
import com.ardor3d.light.Light;
import com.ardor3d.light.PointLight;
import com.ardor3d.light.SpotLight;
import com.ardor3d.renderer.state.BlendState;
import com.ardor3d.renderer.state.ClipState;
import com.ardor3d.renderer.state.ColorMaskState;
import com.ardor3d.renderer.state.CullState;
import com.ardor3d.renderer.state.FogState;
import com.ardor3d.renderer.state.LightState;
import com.ardor3d.renderer.state.MaterialState;
import com.ardor3d.renderer.state.RenderState;
import com.ardor3d.renderer.state.ShadingState;
import com.ardor3d.renderer.state.StencilState;
import com.ardor3d.renderer.state.TextureState;
import com.ardor3d.renderer.state.WireframeState;
import com.ardor3d.renderer.state.ZBufferState;
import com.ardor3d.scenegraph.Mesh;
import com.ardor3d.scenegraph.Node;
import com.ardor3d.scenegraph.Spatial;
import com.ardor3d.scenegraph.controller.SpatialController;

/**
 * @author Andrew Carter
 */
public class StandardPropertyPageHandler extends A_PropertyPageHandler {

	/**
	 * @param table
	 */
	public StandardPropertyPageHandler(PropertyTable table) {
		super(table);
	}

	/**
	 * 
	 */
	@Override
	protected void initPropertyPages(PropertyTable table) {

		table.addCellEditor(Vector3fPropertyObject.class, new Vector3fEditor());
		table.addCellEditor(QuaternionPropertyObject.class, new QuaternionEditor());
		table.addCellEditor(ColorRGBAPropertyObject.class, new ColorRGBAEditor());
		
		table.addCellRenderer(Vector3fPropertyObject.class, new Vector3fRenderer());
		table.addCellRenderer(QuaternionPropertyObject.class, new QuaternionRenderer());
		table.addCellRenderer(ColorRGBAPropertyObject.class, new ColorRGBARenderer());

		registerPropertyPage(Spatial.class, new SpatialPropertyPage());
		registerPropertyPage(Node.class, new NodePropertyPage());
		registerPropertyPage(Mesh.class, new GeometryPropertyPage());
		registerPropertyPage(SpatialController.class, new ControllerPropertyPage());
		registerPropertyPage(Light.class, new LightPropertyPage());
		registerPropertyPage(PointLight.class, new PointLightPropertyPage());
		registerPropertyPage(DirectionalLight.class, new DirectionalLightPropertyPage());
		registerPropertyPage(SpotLight.class, new SpotLightPropertyPage());
		registerPropertyPage(Texture.class, new TexturePropertyPage());
		registerPropertyPage(RenderState.class, new RenderStatePropertyPage());
		registerPropertyPage(BlendState.class, new BlendStatePropertyPage());
		registerPropertyPage(ClipState.class, new ClipStatePropertyPage());
		registerPropertyPage(ColorMaskState.class, new ColorMaskStatePropertyPage());
		registerPropertyPage(CullState.class, new CullStatePropertyPage());
		registerPropertyPage(FogState.class, new FogStatePropertyPage());
		registerPropertyPage(LightState.class, new LightStatePropertyPage());
		registerPropertyPage(MaterialState.class, new MaterialStatePropertyPage());
		registerPropertyPage(ShadingState.class, new ShadeStatePropertyPage());
		registerPropertyPage(StencilState.class, new StencilStatePropertyPage());
		registerPropertyPage(TextureState.class, new TextureStatePropertyPage());
		registerPropertyPage(WireframeState.class, new WireframeStatePropertyPage());
		registerPropertyPage(ZBufferState.class, new ZBufferStatePropertyPage());
	}
}
